#include <iostream>

// #define ADD(a, b) \
//     ({int _a = (a); int _b = (b); \
//      _a + _b; })

// #define MAX(a, b) ((a) >= (b) ? (a) : (b))

#define LOG() printf("error in %s (%d) -%s\n", __FILE__, __LINE__, __FUNCTION__)

#define ERROR_MSG(ret_val, standard, err_msg) \
    ({if (ret_val != standard) {        \
        printf("abnormal return value in file %s line(%d) function-%s\n", __FILE__, __LINE__, __FUNCTION__); \
        puts(err_msg);            \
    } })

int main()
{
    int num1 = 1;
    int num2 = 2;

    // std::cout << "max of 1,2 = " << MAX(num1, num2) << std::endl;

    // std::cout << "sum = " << ADD(num1, num2) << std::endl;

    int ret = -1;
    ERROR_MSG(ret, 0, "something wrong");
    ERROR_MSG(false, true, "something wrong");

    return 0;
}